package com.netease.xone.dataMgr;

import java.util.HashMap;
import java.util.Map;

/***
 * 内存数据存放位置，存放app的生命周期内都需要保存的数据或不想放在界面管理的数据
 * @author echo
 * @since  2013-04-15
 *
 */

public class MemoryDataCenter {
	
	private static MemoryDataCenter mdc = null;
	private Map<String, Object> data = new HashMap<String, Object>();
	
	public static synchronized MemoryDataCenter getInstance() {
		if (mdc == null) {
			mdc = new MemoryDataCenter();
		}
		return mdc;
	}
	
	public void put(String key, Object value) {
		data.put(key, value);
	}
	
	public void remove(String key) {
		data.remove(key);
	}
	
	public void clear() {
		data.clear();
	}
	public Object get(String key) {
		return data.get(key);
	}

}
